<template>
	<div class="account-login-container"></div>
</template>

<script>
import { getLoginUrl } from '@/api/api';
export default {
	name: '',
	components: {},
	props: {},
	data() {
		return {};
	},
	mounted() {
		this.initLoginUrl();
	},
	methods: {
		async initLoginUrl() {
			try {
				let params = {
					// redirect_uri: `https://localhost:8080/login`, //本地
					redirect_uri: `${loginUrl}/login`,
					org: 'x'
				};
				const { data } = await getLoginUrl(params);
				console.log(data, 'getLoginUrl  success');
				if (data?.code == 200) {
					console.log(data.data.url);
					// window.location.href = data.data.url;
					window.open(data.data.url);
				} else {
					console.log('initLoginUrl function error ', data.data);
				}
			} catch (error) {
				console.log(error);
			}
		}
	}
};
</script>

<style lang="less" scoped></style>
